// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   RoleDTO.java

package com.hfstu.pms.dto;

import com.hfstu.pms.model.Role;
import com.hfstu.pms.model.RoleGroup;
import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import org.apache.commons.beanutils.BeanUtils;

public class RoleDTO
{

	private String id;
	private Integer status;
	private Date createTime;
	private Date lastChangeTime;
	private String code;
	private String name;
	private String roleGroupId;
	private String roleGroupName;
	private String systemCode;

	public RoleDTO()
	{
		status = Integer.valueOf(0);
	}

	public String getId()
	{
		return id;
	}

	public void setId(String id)
	{
		this.id = id;
	}

	public Integer getStatus()
	{
		return status;
	}

	public void setStatus(Integer status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getLastChangeTime()
	{
		return lastChangeTime;
	}

	public void setLastChangeTime(Date lastChangeTime)
	{
		this.lastChangeTime = lastChangeTime;
	}

	public String getCode()
	{
		return code;
	}

	public void setCode(String code)
	{
		this.code = code;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getRoleGroupId()
	{
		return roleGroupId;
	}

	public void setRoleGroupId(String roleGroupId)
	{
		this.roleGroupId = roleGroupId;
	}

	public String getRoleGroupName()
	{
		return roleGroupName;
	}

	public void setRoleGroupName(String roleGroupName)
	{
		this.roleGroupName = roleGroupName;
	}

	public String getSystemCode()
	{
		return systemCode;
	}

	public void setSystemCode(String systemCode)
	{
		this.systemCode = systemCode;
	}

	public RoleDTO transfer(Role role)
	{
		try
		{
			BeanUtils.copyProperties(this, role);
		}
		catch (IllegalAccessException e)
		{
			e.printStackTrace();
		}
		catch (InvocationTargetException e)
		{
			e.printStackTrace();
		}
		if (role.getRoleGroup() != null)
		{
			setRoleGroupId(role.getRoleGroup().getId());
			setRoleGroupName(role.getRoleGroup().getName());
		}
		return this;
	}
}
